<%@ tag language="java" pageEncoding="UTF-8" %>  
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}"/>
<%@ attribute name="moduleCode" required="true" rtexprvalue="true"%>

<div id="shareFileNewestPanel" ng-controller="ShareFileNewestCtrl"  class="ng-cloak">   
  <ul style="list-style: none;padding:1px 2px">
    <li style="border-bottom: 1px dashed #EAEAEA;" ng-repeat="row in shareFiles" id="shareFileNewestRow{{$index}}" ng-mouseover="showflag=1" ng-mouseleave="showflag=0" ng-init="showflag=0">
      
        <a href="${contextPath}/oa/shareFile/open.do?id={{row.id}}" target="_blank" title="直接打开">{{row.fileName}}</a>&nbsp;
          <span class="tools"  ng-show="showflag" >
            <a href="${contextPath }/oa/shareFile/download.do?id={{row.id }}" target="_blank" title="直接下载"><i class="icon-cloud-download"></i></a>&nbsp;
          </span> 
          <span class="pull-right"> 
            <small class="grey">[{{row.createDatetime | date: 'yyyy-MM-dd'}}]</small>
          </span>
    </li>
  </ul>  
</div>

<script type="text/javascript">
function ShareFileNewestCtrl($scope, $http) {
  $scope.shareFiles = [];
  //init
  $http.get('${contextPath}/oa/shareFile/getNewest.json?moduleCode=${moduleCode}', {
  }).success(function(data) {
      $scope.shareFiles = data.shareFileList; 
  }); 

}
</script> 